﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using mighty.on;

namespace Mighty.Mighty
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            Service webService = new Service();
            try
            {
                if (webService.Login(txtId.Text, txtPassword.Text))
                {
                    btnReload lobbyform = new btnReload(txtId.Text);
                    this.Visible = false;
                    lobbyform.ShowDialog();
                }
                else
                {
                    MessageBox.Show("로그인 실패했습니다.");
                    txtId.Clear();
                    txtPassword.Clear();
                    txtId.Focus();
                }
            } 
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }
    }
}
